#include "SavingsAccount.h"

SavingsAccount::SavingsAccount(int balance, const Date& timeForSaving, float depositPercent)
	: Account(balance), timeForSaving(timeForSaving), depositPercent(depositPercent)
{

}

float SavingsAccount::getDepositePrecentage()
{
	return depositPercent;
}

bool SavingsAccount::operator==(const SavingsAccount& other)	const
{

	if (Account::operator==(other))
	{
		SavingsAccount* savingAccount = (SavingsAccount*)&other;
		if (depositPercent == savingAccount->getDepositePrecentage())
		{
			return true;
		}
	}

	return false;
}

void SavingsAccount::toOs(ostream& os)			const
{
	os << "SavingAccount={Saving=" << timeForSaving << ", DepositPercent=" << depositPercent << "\n\t";
	Account::toOs(os);
	os << "}";
}

SavingsAccount::~SavingsAccount()
{
	
}